/*
 * ApplicationSettingsImpl.java
 *
 * Copyright 2007, 2008 Tiberiumlabs
 *
 * This file is part of Tiberiumlabs Lailaps.
 *
 * Tiberiumlabs Lailaps is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 3 of the License, or
 * (at your option) any later version.
 *
 * Tiberiumlabs Lailaps is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

package org.tiberiumlabs.lailaps.settings;

/**
 * @author <a href="mailto:paranoid.tiberiumlabs@gmail.com">Paranoid</a>
 */
public class ApplicationSettingsImpl implements ApplicationSettings {
    
    /** Creates a new instance of ApplicationSettingsImpl */
    public ApplicationSettingsImpl() {
    }
    
    private String version = "20080202";
    private String outputFolder = LAILAPS_HOME + FILESEPARATOR + "output" + FILESEPARATOR;
    private String listFile = LAILAPS_HOME + FILESEPARATOR + "list.xml.gz";
    
    // history
    private boolean enableHistory = true;
    private int storeHistoryDays = 90;
    private int historySizeLimitKb = 0;
    private boolean notifyDownloadsInHistory = false;
    
    //behaviour
    private int port = Settings.isDebugMode() ? 8422 : 8421;
    private boolean removeFinished = false;
    private boolean keepServerTime = false;
    private boolean askBeforeExit = false;
    private boolean askBeforeRemove = true;
    private boolean autostartDownloads = false;
    private boolean silentDrop = true;
    private boolean addToFront = false;
    private boolean needListBackuping = true;
    private boolean alowDuplicates = false;
    
    //language
    private boolean useSystemLocale = true;
    private String customLocale;
    
    //integraion
    private boolean konquerorIntegrated = false;
    private boolean firefoxIntegrated = false;
    
    public String getVersion() {
        return version;
    }
    
    // <editor-fold defaultstate="collapsed" desc=" Enviroment settings ">
    
    public String getOutputFolder() {
        return outputFolder;
    }
    
    public void setOutputFolder(String outputFolder) {
        if (outputFolder.endsWith(ApplicationSettings.FILESEPARATOR)) {
            this.outputFolder = outputFolder;
            return;
        }
        this.outputFolder = outputFolder + ApplicationSettings.FILESEPARATOR;
    }
    
    public String getListFile() {
        return listFile;
    }
    
    public void setListFile(String listFile) {
        this.listFile = listFile;
    }
    
    // </editor-fold>
    
    // <editor-fold defaultstate="collapsed" desc=" Behaviour settings ">
    
    public int getPort() {
        return port;
    }
    
    public void setPort(int port) {
        this.port = port;
    }
    
    public boolean isRemoveFinished() {
        return removeFinished;
    }
    
    public void setRemoveFinished(boolean removeFinished) {
        this.removeFinished = removeFinished;
    }
    
    public boolean isKeepServerTime() {
        return keepServerTime;
    }
    
    public void setKeepServerTime(boolean keepServerTime) {
        this.keepServerTime = keepServerTime;
    }
    
    public boolean isAskBeforeExit() {
        return askBeforeExit;
    }
    
    public void setAskBeforeExit(boolean askBeforeExit) {
        this.askBeforeExit = askBeforeExit;
    }
    
    public boolean isAskBeforeRemove() {
        return askBeforeRemove;
    }
    
    public void setAskBeforeRemove(boolean askBeforeRemove) {
        this.askBeforeRemove = askBeforeRemove;
    }
    
    public boolean isSilentDrop() {
        return silentDrop;
    }
    
    public void setSilentDrop(boolean silentDrop) {
        this.silentDrop = silentDrop;
    }
    
    public boolean isAutostartDownloads() {
        return autostartDownloads;
    }
    
    public void setAutostartDownloads(boolean autostartDownloads) {
        this.autostartDownloads = autostartDownloads;
    }
    
    public void setAddToFront(boolean addToFront) {
        this.addToFront = addToFront;
    }
    
    public boolean isAddToFront() {
        return addToFront;
    }

    public boolean isNeedListBackuping() {
        return needListBackuping;
    }

    public void setNeedListBackuping(boolean needListBackuping) {
        this.needListBackuping = needListBackuping;
    }

    public boolean isAlowDuplicates() {
        return alowDuplicates;
    }

    public void setAlowDuplicates(boolean alowDuplicates) {
        this.alowDuplicates = alowDuplicates;
    }
      
    //</editor-fold>
    
    // <editor-fold defaultstate="collapsed" desc=" Language settings ">
    
    public boolean isUseSystemLocale() {
        return useSystemLocale;
    }
    
    public String getCustomLocale() {
        return customLocale;
    }
    
    public void setUseSystemLocale(boolean useSystemLocale) {
        this.useSystemLocale = useSystemLocale;
    }
    
    public void setCustomLocale(String customLocale) {
        this.customLocale = customLocale;
    }
    
    // </editor-fold>
    
    // <editor-fold defaultstate="collapsed" desc=" Integration settings ">
    
    public boolean isKonquerorIntegrated() {
        return konquerorIntegrated;
    }
    
    public void setKonquerorIntegrated(boolean konquerorIntegrated) {
        this.konquerorIntegrated = konquerorIntegrated;
    }
    
    public boolean isFirefoxIntegrated() {
        return firefoxIntegrated;
    }
    
    public void setFirefoxIntegrated(boolean firefoxIntegrated) {
        this.firefoxIntegrated = firefoxIntegrated;
    }

    // </editor-fold>

    // <editor-fold defaultstate="collapsed" desc=" History settings ">
    
    public boolean isEnableHistory() {
        return enableHistory;
    }

    public void setEnableHistory(boolean enableHistory) {
        this.enableHistory = enableHistory;
    }

    public int getHistorySizeLimitKb() {
        return historySizeLimitKb;
    }

    public void setHistorySizeLimitKb(int historySizeLimitKb) {
        this.historySizeLimitKb = historySizeLimitKb;
    }

    public boolean isNotifyDownloadsInHistory() {
        return notifyDownloadsInHistory;
    }

    public void setNotifyDownloadsInHistory(boolean notifyDownloadsInHistory) {
        this.notifyDownloadsInHistory = notifyDownloadsInHistory;
    }
    
    public int getStoreHistoryDays() {
        return storeHistoryDays;
    }

    public void setStoreHistoryDays(int storeHistoryDays) {
        this.storeHistoryDays = storeHistoryDays;
    }
    // </editor-fold>
    
}
